package behavior.state;

/**
 * @author dali
 * @date 2021-07-28 15:18
 * @Description
 */

public class Running extends State {
    public Running() {
        System.out.println("当前线程处于：运行状态");
    }
    @Override
    public void suspend(Context context) {
        System.out.print("阻塞条件达成-->");
        context.setState(new Blocked());
    }
    @Override
    public void stop(Context context) {
        System.out.print("线程执行完毕-->");
        context.setState(new Dead());
    }
}
